/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.valstorm.dao;

import br.valstorm.model.User;
import java.util.HashMap;
import java.util.Map;
import javax.ejb.Stateless;

/**
 *
 * @author rgrunitzki
 */
@Stateless
public class UserDAO extends GenericDAO<User> {

    public UserDAO() {
        super(User.class);
    }

    public User findUserByEmail(String email) {
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("email", email);
        return super.findOneResult(User.FIND_BY_EMAIL, parameters);
    }
    
    public void delete(User object){
        super.delete(object.getId(), User.class);
    }

}
